<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
	<title>迷你酥 - 用户首页</title>
    <%@ include file="../site/jspf/head-tag.jspf" %>
	<link rel="stylesheet" href="<%=request.getContextPath()%>/static/talent/css/homepage.css">
	<link rel="stylesheet" href="<%=request.getContextPath()%>/static/talent/css/profile.css">
	<link rel="stylesheet" href="<%=request.getContextPath()%>/static/talent/css/resume.css">
	<script src="<%=request.getContextPath()%>/static/comm/plugin/jquery.min.js"></script>
</head>
<body>
    <%@ include file="../site/jspf/user-header.jspf" %>

    <section class="top-search" id="topSearchOriginal">
		<div class="top-search-form clearfix">
			<form method="get" action="/companyl/search/">
				<input id="MSSQType" value="2" type="hidden">
				<input name="stype" id="MSSSType" value="" type="hidden">
				<fieldset>
					<input type="text" name="q" id="MSSFloor" placeholder="搜一搜" maxlength="30" value="">
					<input type="submit" value="搜索">
				</fieldset>
			</form>
			<p>热搜词：
				<a href="/companyl/search/?q=华为">华为</a>
				<a href="/companyl/search/?q=百度">百度</a>
				<a href="/companyl/search/?q=中国移动">中国移动</a>
				<a href="/companyl/search/?q=富士康">富士康</a>
				<a href="/companyl/search/?q=联想">联想</a>
			</p>
		</div>
	</section>
	<div class="container profiles pool clearfix">
	<div class="helpless_label"></div>
	<aside class="profiles_vcard">
		<div class="p_v_icon">
			<img src="http://img.kanzhun.com/images/avatar/9df944f6dc1bfe28ffde148cde348b2a.jpg" id="profilePortrait">
			<i class="male"></i> 
			<a href="#" id="profilePortraitBtn">更换头像</a>
		</div>
		<h2 title="${talentPo.nickname}">${talentPo.nickname}</h2>
		<ul class="p_v_info mb10">
			<li></li>
		</ul>
		<p class="p_v_integral">
			<a href="/integralhelp.html" target="_blank"
				class="links fright f_12">如何赚积分？</a> 积分：<em id="j-integral-number">45</em>
			<span class="f_14"> 分</span>
		</p>
		<p class="p_v_sign">
			<span class="bt_sign already">今日已签到</span> <a href="/exchange.html" class="integral_exchange">积分兑换</a>
		</p>
		<nav class="p_v_nav">
			<p class="current">
				<a href="<%=request.getContextPath()%>/TalentServlet?act=toUserPage">我的主页</a>
			</p>
			<p>
				<a href="<%=request.getContextPath()%>/TalentServlet?act=showAllResumes">我的简历</a>
			</p>
			<p>
				<a href="/usercenter/jobsearcher/">职位订阅</a>
			</p>
			<p>
				<a href="/resume/deliver/">投递的职位</a>
			</p>
			<p>
				<a href="/usercenter/jobcollection/">收藏的职位</a>
			</p>
			<p>
				<a href="/usercenter/followcompany/">关注的公司</a>
			</p>
			<p>
				<a href="/usercenter/content/">发布的内容</a>
			</p>
			<p>
				<a href="/usercenter/message/" class="mynews">我的消息</a>
			</p>
			<dl class="mysets">
				<dt>
					我的设置<i class="trangle upTranslate"></i>
				</dt>
				<dd>
					<p>
						<a href="<%=request.getContextPath()%>/TalentServlet?act=toAccountSetPage">-&nbsp;&nbsp;账号设置</a>
					</p>
					<p>
						<a href="<%=request.getContextPath()%>/TalentServlet?act=toPersonInfoPage">-&nbsp;&nbsp;个人信息</a>
					</p>
				</dd>
			</dl>
		</nav>
	</aside>

	<section class="profiles_con">
		<div id="resumeWrapper" class="mt20">
			<p>
				<span class="grey_99 fright">最后更新日期：2015-09-29</span>
				<strong class="f_16">我的简历</strong>
			</p>
			
			<h3 class="p_tt">基本资料</h3>
			<p class="line_d"></p>
			<div class="rsm_completed def_model">
				<a href="javascript:;" class="rsm_edit_p" ></a>
				<p>
					${talentPo.name} <em>|</em> ${talentPo.genderStr} <em>|</em> ${talentPo.educationStr} <em>|</em> ${talentPo.age}
				</p>
				<p>
					${talentPo.phone} <em>|</em> ${talentPo.email}
				<p>我是${talentPo.educationStr}生</p>
				<p>&nbsp;</p>
				<div class="rsm_portrait">
					<img src="http://img.kanzhun.com/images/img_cp.jpg" alt="">
				</div>
			</div>
				
			<h3 class="p_tt">期望工作</h3>
			<p class="line_d"></p>
			<form action="" id="intentionForm" method="post" style="display: none;" data-validator-option="{theme:'yellow_right_effect',stopOnError:true}">
		        <input type="hidden" name="id" value="108670">
		        <fieldset class="rsm_editing" style="z-index: 3;">
		            
		            <ul>
		                <li style="z-index: 3;">
		                	<label class="def"><em>*</em> 期望职位</label>
		                	<input type="text" class="ifd" placeholder="如：产品经理" id="intention" name="intention" maxlength="20" value="${resumePo.intention}" data-rule="期望职位:required;intention">
		                </li>
						<li>
		                    <label class="def"><em>*</em> 期望月薪</label>
	                        <dl class="select select_s">
	                            <dt>
	                                <input id="salaryStr" type="hidden" name="salaryStr" value="1千-3千">
	                                <input id="salaryDes" type="button" name="salaryDes" value="1千-3千" readonly="readonly">
	                                <span id="selectSalary" class="btn"><i></i></span>
	                            </dt>
	                            <dd id="salaryDetail" style="display: none;">
                                       <a href="javascript:;" rel="nofollow" data-val="3">1千-3千</a>
                                       <a href="javascript:;" rel="nofollow" data-val="4">3千-5千</a>
                                       <a href="javascript:;" rel="nofollow" data-val="5">5千-8千</a>
                                       <a href="javascript:;" rel="nofollow" data-val="6">8千-1万</a>
                                       <a href="javascript:;" rel="nofollow" data-val="7">1万-1.5万</a>
                                       <a href="javascript:;" rel="nofollow" data-val="8">1.5万-2万</a>
                                       <a href="javascript:;" rel="nofollow" data-val="9">2万-2.5万</a>
                                       <!--<a href="javascript:;" rel="nofollow" data-val="10">2.5万以上</a>-->
	                            </dd>
	                            <script>
                                	var selectSalary = document.getElementById("selectSalary");
                                	var salaryDetail = document.getElementById("salaryDetail");
                                	var salaryArr = salaryDetail.getElementsByTagName("a");
                                	selectSalary.onclick = function() {
                                		if(this.className == "btn") {
                                			this.className = "btn on";
                                			salaryDetail.style.display = "block";
                                		} else {
                                			this.className = "btn";
                                			salaryDetail.style.display = "none";
                                		}
                                	}
                                	for(var i = 0; i < salaryArr.length; i++) {
                                		salaryArr[i].onclick = function() {
                                			document.getElementById("salaryDes").value = this.innerHTML;
                                			document.getElementById("salaryStr").value = this.innerHTML;
                                			selectSalary.className = "btn";
                                			salaryDetail.style.display = "none";
                                		}
                                	}
                                	
	                            </script>
	                        </dl>
		                </li>
		                <li>
		                	<label class="def"></label>
		                	<span class="btn_grey_b">
		                		<input type="button" value="保存" onclick="modifyIntention(this)">
		                	</span>
		                	<input type="reset" value="取消" class="cancel maskui_close">
		                </li>
		                
		            </ul>
		        </fieldset>
		    </form>
			<div class="rsm_completed def_model" id="intentionDiv">
				<a href="javascript:;" class="rsm_edit_p balabala" ></a>
				<p>
					${resumePo.expectMinSalary}-${resumePo.expectMinSalary}
				</p>
				<p>${resumePo.intention}</p>
			</div>
			
			<h3 class="p_tt">工作经历</h3>
			<p class="line_d"></p>
			<form action="" id="workExperienceForm" method="post" style="display: none;" data-validator-option="{theme:'yellow_right_effect',stopOnError:true}">
		        <fieldset class="rsm_editing" style="z-index: 3;">
		            <ul>
		            	<li class="auto_h">
		            		<label class="def"><em>*</em> 工作描述</label>
		            		<textarea name="workExperience" id="workExperience" cols="30" rows="6" placeholder="请详细描述您所负责的具体工作内容。" maxlength="500" data-rule="工作经验:required;workExperience"></textarea>
                   			<p class="err" data-msg="请详细描述您所负责的具体工作内容！"></p>
               			</li>
		            	
		                <li>
		                	<label class="def"></label>
		                	<span class="btn_grey_b">
		                		<input type="button" value="保存" onclick="modifyWorkExperience()">
		                	</span>
		                	<input type="reset" value="取消" class="cancel maskui_close">
		                </li>
		                
		            </ul>
		        </fieldset>
		    </form>
			<div class="rsm_completed def_model" id="workExperienceDiv">
				<a href="javascript:;" class="rsm_add balabala" ><i></i>添加工作经历</a>
				<p>${resumePo.workExperience}</p>
			</div>
			
			
			<h3 class="p_tt">项目经验</h3>
			<p class="line_d"></p>
			<form action="" id="projectExperienceForm" method="post" style="display: none;" data-validator-option="{theme:'yellow_right_effect',stopOnError:true}">
		        <fieldset class="rsm_editing" style="z-index: 3;">
		            <ul>
		            	<li class="auto_h">
		            		<label class="def"><em>*</em> 项目描述</label>
		            		<textarea name="projectExperience" id="projectExperience" cols="30" rows="6" placeholder="请详细描述您所负责的具体项目内容。" maxlength="500" data-rule="项目经验:required;projectExperience"></textarea>
                   			<p class="err" data-msg="请详细描述您所负责的具体项目内容！"></p>
               			</li>
		            	
		                <li>
		                	<label class="def"></label>
		                	<span class="btn_grey_b">
		                		<input type="button" value="保存" onclick="modifyProjectExperience()">
		                	</span>
		                	<input type="reset" value="取消" class="cancel maskui_close">
		                </li>
		                
		            </ul>
		        </fieldset>
		    </form>
			<div class="rsm_completed def_model" id="projectExperienceDiv">
				<a href="javascript:;" class="rsm_add balabala" ><i></i>添加项目经验</a>
				<p>${resumePo.projectExperience}</p>
			</div>
				
			<h3 class="p_tt">教育经历</h3>
			<p class="line_d"></p>
			<form action="" id="educationForm" method="post" style="display: none;">
		        <fieldset class="rsm_editing" style="z-index: 3;">
		            <ul>
		            	<li>
		                    <label class="def"><em>*</em> 学历程度</label>
	                        <dl class="select select_s">
	                            <dt>
	                                <input id="education" type="hidden" name="education" value="1">
	                                <input id="educationStr" type="button" name="educationStr" value="专科" readonly="readonly">
	                                <span id="selectEducation" class="btn"><i></i></span>
	                            </dt>
	                            <dd id="educationDetail" style="display: none;">
                                       <a href="javascript:;" rel="nofollow" data-val="1">专科</a>
                                       <a href="javascript:;" rel="nofollow" data-val="2">本科</a>
                                       <a href="javascript:;" rel="nofollow" data-val="3">研究生</a>
	                            </dd>
	                            <script>
                                	var selectEducation = document.getElementById("selectEducation");
                                	var educationDetail = document.getElementById("educationDetail");
                                	var educationArr = educationDetail.getElementsByTagName("a");
                                	selectEducation.onclick = function() {
                                		if(this.className == "btn") {
                                			this.className = "btn on";
                                			educationDetail.style.display = "block";
                                		} else {
                                			this.className = "btn";
                                			educationDetail.style.display = "none";
                                		}
                                	}
                                	for(var i = 0; i < educationArr.length; i++) {
                                		educationArr[i].onclick = function() {
                                			document.getElementById("education").value = $(this).data("val");
                                			document.getElementById("educationStr").value = this.innerHTML;
                                			selectEducation.className = "btn";
                                			educationDetail.style.display = "none";
                                		}
                                	}
                                	
	                            </script>
	                        </dl>
		                </li>
		            	
		                <li>
		                	<label class="def"></label>
		                	<span class="btn_grey_b">
		                		<input type="button" value="保存" onclick="modifyEducation()">
		                	</span>
		                	<input type="reset" value="取消" class="cancel maskui_close">
		                </li>
		                
		            </ul>
		        </fieldset>
		    </form>
			<div class="rsm_completed def_model" id="educationDiv">
				<a href="javascript:;" class="rsm_edit_p balabala" ><i></i></a>
				<p>${talentPo.educationStr}</p>
			</div>
				
			<aside class="resume_bar" id="resumeBar">
				<strong>我的简历</strong>
				<nav>
					<a href="#ritem1" rel="nofollow">基本资料 <i></i></a>
					<a href="#ritem2" rel="nofollow">期望工作 <i></i></a>
					<a href="#ritem3" rel="nofollow">工作经历 <i></i></a>
					<a href="#ritem4" rel="nofollow">项目经验 <i></i></a>
					<a href="#ritem5" rel="nofollow">教育经历 <i></i></a>
					<span><i class="last"></i></span>
				</nav>
			</aside>
		</section>
		
		<script src="<%=request.getContextPath()%>/static/comm/plugin/layer/layer.js"></script>
		<script>
			$(function() {
				$(".balabala").click(function() {
					$(this).parent().css("display", "none");
					$(this).parent().prev().css("display", "block");
				});
				$(".cancel").click(function() {
					$(this).parent().parent().parent().parent().parent().css("display", "none");
					$(this).parent().parent().parent().parent().parent().next().css("display", "block");
				});
			});
			function modifyIntention() {
				var url = "<%=request.getContextPath()%>/ResumeServlet?act=modifyIntention";
				$.ajax({
					type: "POST",		
					url: url,
					data: {
						resumeId: '${resumePo.id}',						
						intention: $("#intention").val(),
						salaryStr: $("#salaryStr").val()
					},
					success: function(data) {
						if(data == "success") {
							layer.msg('操作成功！', {time: 2000, icon: 6});
							$("#intentionForm").css("display", "none");
							$("#intentionDiv").css("display", "block");
							$("#intentionDiv").children("p")[0].innerHTML = $("#salaryStr").val();
							$("#intentionDiv").children("p")[1].innerHTML = $("#intention").val();
						} else {
							layer.msg('操作失败！', {time: 2000, icon: 5});
							$("#intentionForm").css("display", "none");
							$("#intentionDiv").css("display", "block");
						}
					}
				});
			}
			
			function modifyWorkExperience() {
				var url = "<%=request.getContextPath()%>/ResumeServlet?act=modifyWorkExperience";
				$.ajax({
					type: "POST",		
					url: url,
					data: {
						resumeId: '${resumePo.id}',						
						workExperience: $("#workExperience").val(),
					},
					success: function(data) {
						if(data == "success") {
							layer.msg('操作成功！', {time: 2000, icon: 6});
							$("#workExperienceForm").css("display", "none");
							$("#workExperienceDiv").css("display", "block");
							$("#workExperienceDiv").children("p")[0].innerHTML = $("#workExperience").val();
						} else {
							layer.msg('操作失败！', {time: 2000, icon: 5});
							$("#workExperienceForm").css("display", "none");
							$("#workExperienceDiv").css("display", "block");
						}
					}
				});
			}
			
			function modifyProjectExperience() {
				var url = "<%=request.getContextPath()%>/ResumeServlet?act=modifyProjectExperience";
				$.ajax({
					type: "POST",		
					url: url,
					data: {
						resumeId: '${resumePo.id}',						
						projectExperience: $("#projectExperience").val(),
					},
					success: function(data) {
						if(data == "success") {
							layer.msg('操作成功！', {time: 2000, icon: 6});
							$("#projectExperienceForm").css("display", "none");
							$("#projectExperienceDiv").css("display", "block");
							$("#projectExperienceDiv").children("p")[0].innerHTML = $("#projectExperience").val();
						} else {
							layer.msg('操作失败！', {time: 2000, icon: 5});
							$("#projectExperienceForm").css("display", "none");
							$("#projectExperienceDiv").css("display", "block");
						}
					}
				});
			}
			
			function modifyEducation() {
				var url = "<%=request.getContextPath()%>/ResumeServlet?act=modifyEducation";
				$.ajax({
					type: "POST",		
					url: url,
					data: {
						education: $("#education").val(),
					},
					success: function(data) {
						if(data == "success") {
							layer.msg('操作成功！', {time: 2000, icon: 6});
							$("#educationForm").css("display", "none");
							$("#educationDiv").css("display", "block");
							$("#educationDiv").children("p")[0].innerHTML = $("#educationStr").val();
						} else {
							layer.msg('操作失败！', {time: 2000, icon: 5});
							$("#educationForm").css("display", "none");
							$("#educationDiv").css("display", "block");
						}
					}
				});
			}
		
		</script>
		
	</div>
	<script src="<%=request.getContextPath()%>/static/comm/plugin/nice-validator-1.0.7/dist/jquery.validator.min.js?local=zh-CN"></script>
</body>
</html>